package com.sandy.demo.jpa;

import javax.persistence.AttributeConverter;

public class MovieTypeConvertor implements AttributeConverter<MovieType, String> {
    @Override
    public String convertToDatabaseColumn(MovieType attribute) {
        return String.valueOf(attribute);
    }

    @Override
    public MovieType convertToEntityAttribute(String dbData) {
        return MovieType.parseName(dbData);
    }
}
